# $Id: PKGBUILD 73530 2012-07-09 08:46:34Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Marcel Schneider marcelATcoopmastersDOTde

pkgname=mingw32-pthreads
pkgver=2.9.1
pkgrel=1
arch=(i686 x86_64)
pkgdesc="The POSIX 1003.1-2001 standard for writing multithreaded applications."
license=(LGPL)
makedepends=('mingw32-gcc-base' 'mingw32-runtime' 'mingw32-w32api')
url="http://sourceware.org/pthreads-win32/"
options=(!strip)
source=(ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-${pkgver//./-}-release.tar.gz)
md5sums=('36ba827d6aa0fa9f9ae740a35626e2e3')

build() {
  cd $srcdir/pthreads-w32-${pkgver//./-}-release
  make CROSS=i486-mingw32- clean GC
}

package() {
  cd $srcdir/pthreads-w32-${pkgver//./-}-release
  mkdir $pkgdir/usr
  mkdir $pkgdir/usr/i486-mingw32
  mkdir $pkgdir/usr/i486-mingw32/include
  mkdir $pkgdir/usr/i486-mingw32/lib
  install $srcdir/pthreads-w32-${pkgver//./-}-release/pthread.h $pkgdir/usr/i486-mingw32/include/pthread.h
  install $srcdir/pthreads-w32-${pkgver//./-}-release/sched.h $pkgdir/usr/i486-mingw32/include/sched.h
  install $srcdir/pthreads-w32-${pkgver//./-}-release/semaphore.h $pkgdir/usr/i486-mingw32/include/semaphore.h
  install $srcdir/pthreads-w32-${pkgver//./-}-release/libpthreadGC2.a $pkgdir/usr/i486-mingw32/lib/libpthread.a
  install $srcdir/pthreads-w32-${pkgver//./-}-release/pthreadGC2.dll $pkgdir/usr/i486-mingw32/lib/
}
